package net.zjitc.common;

import java.io.Serializable;

/**
 * @Author admin
 * @Date 2019/4/2 9:36
 */
public class ServiceResponse <T> {
        private int status;
        private String message;
        private T data;

    public ServiceResponse(int status) {
        this.status = status;
    }

    public ServiceResponse(int status, String message) {
        this.status = status;
        this.message = message;
    }

    public ServiceResponse(String message, T data) {
        this.message = message;
        this.data = data;
    }

    public ServiceResponse(int status, String message, T data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }
    public static <T> ServiceResponse createBySuccess(){
        return new ServiceResponse<T>(ResponseCode.SUCCESS.getStatus());
    }
}
